<!--
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author Cheng
-->
<template>
  <div>
    <BasicTable @register="registerDetailTable">
      <template #tableTitle>
        <Icon :icon="getTitle.icon" class="m-1 pr-1" />
        <span> 设备详情 </span>
      </template>
    </BasicTable>
  </div>
</template>
<script lang="ts" setup name="ViewsDeviceManagementInMeasuringEquipmentList">
  import { unref } from 'vue';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { useMessage } from '/@/hooks/web/useMessage';
  import { router } from '/@/router';
  import { Icon } from '/@/components/Icon';
  import { BasicTable, BasicColumn, useTable } from '/@/components/Table';
  import { getDeviceDetails } from '/@/api/device.management/inMeasuringEquipment';
  import { FormProps } from '/@/components/Form';

  const { t } = useI18n('device.management.inMeasuringEquipment');
  const { showMessage } = useMessage();
  const { meta } = unref(router.currentRoute);

  const getTitle = {
    icon: meta.icon || 'i-ant-design:book-outlined',
    value: meta.title || t('检测设备详情'),
  };
  const tableColumns: BasicColumn[] = [
    {
      title: t('id'),
      dataIndex: 'enterpriseName',
      key: 'a.enterprise_name',
      sorter: true,
      width: 130,
      align: 'left',
      onChange:()=>{}
    },
  ];

  const [registerTable, { reload:registerDetailTable }] = useTable({
    api: getDeviceDetails,
    beforeFetch: (params) => {
      return params;
    },
    columns: tableColumns,
    showTableSetting: true,
    useSearchForm: true,
    canResize: true,
  });


  function handleSuccess(record: Recordable) {
    reload({ record });
  }
</script>
